package config

import (
	"github.com/zeromicro/go-zero/rest"
	"github.com/zeromicro/go-zero/zrpc"
)

type FlowLimitItem struct {
	Path     string   // api path
	Enable   bool     //是否开启
	Period   int      //限流窗口
	Warn     int      //警告值
	Quota    int      //限流阀值
	Prefix   string   //限流key定义
	Elements []string //限流维度
}

type Config struct {
	rest.RestConf
	Auth struct {
		AccessSecret string
		AccessExpire int64
	}
	RedisCluster struct {
		Cluster struct {
			Addrs      []string
			Password   string
			MaxRetries int
		}
	}

	SignConf struct {
		Strict      bool
		Fingerprint string
		PrivateKey  string
		Expiry      int64
	}

	// 限流配置
	FlowLimit struct {
		Enable   bool            //限流开关
		Excludes []string        //不进行限流的接口
		Items    []FlowLimitItem //限流接口具体配置
	}

	GoodsRpc zrpc.RpcClientConf
}
